class CreateArtworkCategories < ActiveRecord::Migration
  def self.up
    create_table :artworks_categories, :id => false do |t|
      t.references :artwork
      t.references :category
    end
    
    add_index "artworks_categories", "artwork_id"
    add_index "artworks_categories", "category_id"
    
    execute "INSERT INTO artworks_categories (artwork_id, category_id) values (1,3)"
    execute "INSERT INTO artworks_categories (artwork_id, category_id) values (2,3)"
  end

  def self.down
    drop_table :artwork_categories
  end
end
